Fixed _gtk_size_group_bump_requisition() to properly handle values specified by gtk_w...
authorTristan Van Berkom <tristan.van.berkom@gmail.com>
Mon, 19 Apr 2010 00:45:42 +0000 (20:45 -0400)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Mon, 19 Apr 2010 00:45:42 +0000 (20:45 -0400)
gtk/gtkextendedlayout.c
gtk/gtksizegroup.c

index 92a1c640cf36d04545ca803d05e0b6a07b7ff4dc..b764f46304b189d99ecdbb62bf47562800904086 100644 (file)
@@ -230,6 +230,8 @@ compute_size_for_orientation (GtkExtendedLayout *layout,
 
       /* Get size groups to compute the base requisition once one of the values have been cached,
        * then go ahead and update the cache with the sizegroup computed value.
+       *
+       * Note this is also where values from gtk_widget_set_size_request() are considered.
        */
       group_size = 
        _gtk_size_group_bump_requisition (GTK_WIDGET (layout), 
index c6723902307b0ddfba467b0debfc2d3afc214611..56965aa9bb6e21c7346ba171e3dc5057d6464944 100644 (file)
@@ -750,13 +750,31 @@ _gtk_size_group_bump_requisition (GtkWidget        *widget,
 {
   gint result = widget_requisition;
 
-  if (!is_bumping (widget) && get_size_groups (widget))
+  if (!is_bumping (widget))
     {
+      GtkWidgetAuxInfo *aux_info = 
+       _gtk_widget_get_aux_info (widget, FALSE);
+
       /* Avoid recursion here */
       mark_bumping (widget, TRUE);
 
-      result = compute_dimension (widget, mode, widget_requisition);
-
+      if (get_size_groups (widget))
+       {
+         if (aux_info)
+           {
+             if (mode == GTK_SIZE_GROUP_HORIZONTAL)
+               result = compute_dimension (widget, mode, MAX (aux_info->width, widget_requisition));
+             else 
+               result = compute_dimension (widget, mode, MAX (aux_info->height, widget_requisition));
+           }
+       }
+      else if (aux_info)
+       {
+         if (mode == GTK_SIZE_GROUP_HORIZONTAL)
+           result = MAX (aux_info->width, widget_requisition);
+         else 
+           result = MAX (aux_info->height, widget_requisition);
+       }
       mark_bumping (widget, FALSE);
     }
   return result;